unit Rails.Aurelius.Active;

interface

uses
  Rails.Orm.Active, Aurelius.Mapping.Explorer, Rails.ActiveRecord.Attributes;

type
  TAureliusColumn = class(TColumnActive)
   // class procedure Active(AColumn: Column); overload;
  end;

implementation

uses
  Aurelius.Mapping.Setup, Aurelius.Mapping.Metadata;

{ TAureliusColumn }

{class procedure TAureliusColumn.Active(AColumn: Column);
var
  RttiExp: TMappingSetup;
  Props: TColumnProps;
  Col: TColumn;
begin
  if (cvUnique in AColumn.Properties) then
    Props := [TColumnProp.Unique];
  if (cvRequired in AColumn.Properties) then
    Props := [TColumnProp.Required];
  if (cvNoInsert in AColumn.Properties) then
    Props := [TColumnProp.NoInsert];
  if (cvNoUpdate in AColumn.Properties) then
    Props := [TColumnProp.NoUpdate];
  if (cvLazy in AColumn.Properties) then
    Props := [TColumnProp.Lazy];

  if AColumn.Length = 0 then
    TDynamicColumn.Create(AColumn.Name, Props, AColumn.Precision, AColumn.Scale)
  else
    TDynamicColumn.Create(AColumn.Name, Props, AColumn.Length);
end;   }

end.
